package com.cgsd.heyu.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;

/**
 * author Administrator
 * time:23:16
 * descrition:
 */
public class SystemUtils {

    /**
     * 打开浏览器
     *
     * @param mActivity ctx
     * @param url       url
     */
    public static void openBrowser(Context mActivity, String url) {
        if (mActivity == null || TextUtils.isEmpty(url))
            return;
        if (url.startsWith("http") || url.startsWith("https")) {
            Intent intent = new Intent();
            intent.setAction("android.intent.action.VIEW");
            Uri uri = Uri.parse(url);
            intent.setData(uri);
            mActivity.startActivity(intent);
        }
    }
}
